#coding:utf-8
'''
create on 2017-07-15

@author: sandy
'''

import  logging
import ServerConfig
from pycommon import RemoteManager

class HallConfig(object):
    
    def __init__(self):
        self.rundir = ServerConfig.instance.rundir
        self.hallconfig = None
    
    def onRemoteConfig(self, cfgname, jf):
        ctype,cname = cfgname.split(u".")
        if ctype==u'server'+unicode(RemoteManager.instance.sid) and cname==u'hallconfig':
            self.loadFromJson(jf)
            
    def loadFromJson(self, jf):
        logging.debug("hallconfig loadFromJson")
        self.hallconfig = jf
        
    def getHallConfig(self):
        return self.hallconfig
    
    
instance = HallConfig()

if __name__ == '__main__':
    pass